# -*- coding:utf-8 _*-

'''
@author:yangshuang
@File: 1 .py
@Date: 2021/11/23 21:34 
'''
import uvicorn
from fastapi import FastAPI, Query

app = FastAPI()

@app.get("/")
async def read(*, q: str = Query(None, min_length=2, max_length=5), name: str):
    result = {"q": q, "name": name}
    return result


if __name__ == '__main__':
    uvicorn.run(app='1:app', host="127.0.0.1", port=8000, reload=True, debug=True)
